home *** CD-ROM | disk | FTP | other *** search
/ PC Media 8 / pc-media-windows-95.iso / shared.dir / 00378_MAIN SCRIPTS.ls < prev    next >
Encoding:
Text File  |  1995-08-31  |  12.8 KB  |  573 lines

  1. on InitializeDemo
  2.   global gAutoMode, gTeaserMode, gResellerVersion, gAutoDelay, gMainMovieName, gIntroTimeOut, gInteractiveTimeout, gOEMTimeout, gResellerTimeout, gDialogTimeout, gTeaserList, gCurrTeaser, gDialogResult, gAutoTestMode, gScanExitFlag, gNoHelp, gTopicList, gCurrTopic, gLastForwardBlink, gLastTextBox, gLastScreen, gCDROMversion, gLastAudio, gAudioPath, gSectionAnimationSpeed, gNextKey, gBackKey, gMenuKey, gRestartKey, gExitKey, glasttms
  3.   clearGlobals()
  4.   set glasttms to the timeoutScript
  5.   setUpDemo()
  6.   set gAutoTestMode to 0
  7.   set gAutoMode to 0
  8.   set gTeaserMode to 0
  9.   set gMainMovieName to "A95Demo.DIR"
  10.   set gScanExitFlag to 1
  11.   set gLastAudio to EMPTY
  12.   set gTopicList to field "file list"
  13.   set gCurrTopic to 1
  14.   set gTeaserList to field "teaser list"
  15.   set gCurrTeaser to 0
  16.   set gLastForwardBlink to the ticks
  17.   set gDialogResult to EMPTY
  18.   set gLastTextBox to EMPTY
  19.   set gLastScreen to EMPTY
  20.   if the machineType = 256 then
  21.     set the exitLock to 1
  22.   end if
  23. end
  24.  
  25. on showtimeout
  26.   global glasttms
  27.   if glasttms <> the timeoutScript then
  28.     put the timeoutScript
  29.     put the timeoutLength
  30.     set glasttms to the timeoutScript
  31.   end if
  32. end
  33.  
  34. on startMovie
  35.   global gMainMovieName, gAutoMode, gResellerVersion, gSwapResExit
  36.   if voidp(gAutoMode) then
  37.     InitializeDemo()
  38.   end if
  39.   if the movie <> gMainMovieName then
  40.     setupTopicMovies()
  41.   end if
  42. end
  43.  
  44. on setupTopicMovies
  45.   global gResellerVersion, gCurrCPButton, gCPbuttonIndex, gDontHilite, gLastAudio, gSwapResExit
  46.   set gDontHilite to 0
  47.   set gLastAudio to EMPTY
  48.   repeat with x = 23 to 28
  49.     puppetSprite(x, 1)
  50.   end repeat
  51.   if gResellerVersion = 1 then
  52.     set EXRSbutton to 28
  53.   else
  54.     set EXRSbutton to 27
  55.   end if
  56.   set gCurrCPButton to 1
  57.   set gCPbuttonIndex to "24" & RETURN & EXRSbutton & RETURN & "23" & RETURN & "25"
  58.   if gSwapResExit = 1 then
  59.     set the locH of sprite EXRSbutton to 555
  60.     puppetSprite(26, 1)
  61.     set the locH of sprite 26 to -1000
  62.   end if
  63.   updateStage()
  64. end
  65.  
  66. on chooseInteractive
  67.   global gAutoMode, gResellerTimeout, gOEMTimeout, gResellerVersion
  68.   set the timeoutScript to EMPTY
  69.   set gAutoMode to 0
  70.   if gResellerVersion = 1 then
  71.     resetResellerTimeout()
  72.   else
  73.   end if
  74.   go("p1")
  75. end
  76.  
  77. on resetResellerTimeout
  78.   global gResellerTimeout
  79.   set the timeoutLength to gResellerTimeout
  80.   set the timeoutScript to "timeOutResellerDialog"
  81. end
  82.  
  83. on clearTimeout
  84.   set the timeoutScript to EMPTY
  85.   set the timeoutLength to 0
  86. end
  87.  
  88. on chooseAutoDemo
  89.   global gAutoMode, gTeaserMode
  90.   set the timeoutScript to EMPTY
  91.   set gAutoMode to 1
  92.   set gTeaserMode to 0
  93.   if (the frame - 1) = label("introDialog") then
  94.     clearMenuButtons()
  95.   end if
  96.   go("p1")
  97. end
  98.  
  99. on startAutoDemo
  100.   set the timeoutScript to EMPTY
  101.   selectSection("full tour")
  102. end
  103.  
  104. on doIntroAnimation
  105.   clearMenuButtons()
  106.   set the timeoutScript to EMPTY
  107.   set the timeoutLength to 0
  108.   go("introAnimation")
  109. end
  110.  
  111. on chooseAutoDemoOLD
  112.   global gAutoMode
  113.   set the timeoutScript to EMPTY
  114.   set gAutoMode to 1
  115.   go("blank")
  116.   selectSection("full tour")
  117. end
  118.  
  119. on chooseTeaserDemo
  120.   global gResellerTimeout, gAutoMode, gTeaserMode, gTeaserList, gCurrTeaser
  121.   set the timeoutScript to EMPTY
  122.   set gAutoMode to 1
  123.   set gTeaserMode to 1
  124.   if (the frame - 1) = label("introDialog") then
  125.     clearMenuButtons()
  126.   end if
  127.   set gCurrTeaser to gCurrTeaser + 1
  128.   if gCurrTeaser > the number of lines in gTeaserList then
  129.     set gCurrTeaser to 1
  130.   end if
  131.   go("p1")
  132. end
  133.  
  134. on startTeaserDemo
  135.   global gAutoMode, gTeaserMode, gTeaserList, gCurrTeaser
  136.   set teaser to line gCurrTeaser of gTeaserList
  137.   selectSection(teaser)
  138. end
  139.  
  140. on setSprites default
  141.   global gCurrDialogButton
  142.   set gCurrDialogButton to default
  143.   puppetSprite(2, 1)
  144.   puppetSprite(3, 1)
  145.   if the castNum of sprite 4 <> 0 then
  146.     puppetSprite(4, 1)
  147.   end if
  148. end
  149.  
  150. on hiliteButton s
  151.   global gDontHilite
  152.   if voidp(s) then
  153.     if gDontHilite = 0 then
  154.       set s to the clickOn
  155.     else
  156.       set gDontHilite to 0
  157.       exit
  158.     end if
  159.   end if
  160.   if the puppet of sprite s = 0 then
  161.     set setPuppet to 1
  162.   else
  163.     set setPuppet to 0
  164.   end if
  165.   set h to the locH of sprite s
  166.   set v to the locV of sprite s
  167.   if setPuppet = 1 then
  168.     puppetSprite(s, 1)
  169.   end if
  170.   set the locH of sprite s to h + 2
  171.   set the locV of sprite s to v + 2
  172.   updateStage()
  173.   wait()
  174.   set the locH of sprite s to h
  175.   set the locV of sprite s to v
  176.   updateStage()
  177.   wait()
  178.   if setPuppet = 1 then
  179.     puppetSprite(s, 0)
  180.   end if
  181. end
  182.  
  183. on menuTransition
  184. end
  185.  
  186. on selectSection section
  187.   global gTopicList, gCurrTopic, gCurrSection, gNoHelp
  188.   hiliteButton()
  189.   set gCurrSection to section
  190.   if (gNoHelp = 1) and ((section = "quick tour") or (section = "customizing")) then
  191.     set gTopicList to field (section & " nohelp")
  192.   else
  193.     set gTopicList to field section
  194.   end if
  195.   set gCurrTopic to 1
  196.   hideChecks()
  197.   clearMenuButtons()
  198.   go(1, line gCurrTopic of gTopicList)
  199. end
  200.  
  201. on goMenu menuNUm
  202.   global gMainMovieName, gCurrSection, gLastScreen, gAutoMode, gResellerVersion
  203.   sound stop 1
  204.   if gAutoMode = 1 then
  205.     AutoDecisionDialog()
  206.     exit
  207.   end if
  208.   if not voidp(menuNUm) then
  209.     hideChecks()
  210.     if (gResellerVersion = 0) and (menuNUm = 1) then
  211.       go("menu1eu", gMainMovieName)
  212.     else
  213.       go("menu" & string(menuNUm))
  214.     end if
  215.     showChecksMenu(menuNUm)
  216.     exit
  217.   end if
  218.   if "dial msn exchange plug system plus office" contains gCurrSection then
  219.     pushLastScreen()
  220.     if the movie = gMainMovieName then
  221.       menuTransition()
  222.       go("menu3")
  223.     else
  224.       menuTransition()
  225.       go("menu3", gMainMovieName)
  226.     end if
  227.     menuTransition()
  228.     showChecksMenu(3)
  229.   else
  230.     pushLastScreen()
  231.     if the movie = gMainMovieName then
  232.       go("menu2")
  233.     else
  234.       go("menu2", gMainMovieName)
  235.     end if
  236.     menuTransition()
  237.     showChecksMenu(2)
  238.   end if
  239. end
  240.  
  241. on backToLastFrame
  242.   global gLastScreen
  243.   hiliteButton()
  244.   hideChecks()
  245.   clearMenuButtons()
  246.   set m to gLastScreen
  247.   pushLastScreen()
  248.   if m <> EMPTY then
  249.     if item 2 of m = the movie then
  250.       go(value(item 1 of m))
  251.     else
  252.       go(value(item 1 of m), item 2 of m)
  253.     end if
  254.   end if
  255. end
  256.  
  257. on pushLastScreen
  258.   global gLastScreen
  259.   set frameNo to marker(0)
  260.   set m to the movie
  261.   if m = "W95Demo.EXE" then
  262.     set m to "A95DEMO.DIR"
  263.   end if
  264.   set gLastScreen to frameNo & "," & m
  265. end
  266.  
  267. on goBack
  268.   global gTopicList, gCurrTopic, gAutoMode
  269.   sound stop 1
  270.   if gAutoMode = 1 then
  271.     AutoDecisionDialog()
  272.     exit
  273.   end if
  274.   if the frameLabel contains "start" then
  275.     set gCurrTopic to gCurrTopic - 1
  276.     if (gCurrTopic < 1) or (gCurrTopic > the number of lines in gTopicList) then
  277.       goMenu()
  278.     else
  279.       set topic to line gCurrTopic of gTopicList
  280.       go("end", topic)
  281.     end if
  282.   else
  283.     if the frameLabel = "endCoffee" then
  284.       go("coffee")
  285.     else
  286.       go(marker(-1))
  287.       if the frameScript = 451 then
  288.         go(marker(-1))
  289.       end if
  290.     end if
  291.   end if
  292. end
  293.  
  294. on goNext
  295.   global gTopicList, gCurrTopic, gCurrSection, mouseUp, gLastScreen, gAutoMode, gTeaserMode, gResellerVersion, gAutoDelay, gMainMovieName
  296.   sound stop 1
  297.   if gAutoMode = 1 then
  298.     AutoDecisionDialog()
  299.     exit
  300.   end if
  301.   if the frameLabel = "end" then
  302.     addFinishedTopic(line gCurrTopic of gTopicList)
  303.     set gCurrTopic to gCurrTopic + 1
  304.     if (gCurrTopic < 1) or (gCurrTopic > the number of lines in gTopicList) then
  305.       if gCurrSection = "quick tour" then
  306.         set gLastScreen to the frame & "," & the movie
  307.         go("m3d", gMainMovieName)
  308.       else
  309.         goMenu()
  310.       end if
  311.     else
  312.       set topic to line gCurrTopic of gTopicList
  313.       go(1, topic)
  314.     end if
  315.   else
  316.     go(marker(1))
  317.   end if
  318. end
  319.  
  320. on addFinishedTopic finishedTopic
  321.   global gFinishedTopics
  322.   if not (gFinishedTopics contains finishedTopic) then
  323.     put finishedTopic & RETURN after gFinishedTopics
  324.   end if
  325. end
  326.  
  327. on clearMenuButtons
  328.   global gCurrDialogButton
  329.   repeat with s = 9 to 19
  330.     puppetSprite(s, 0)
  331.   end repeat
  332.   puppetSprite(20, 0)
  333.   set gCurrDialogButton to 0
  334. end
  335.  
  336. on setMenuExitButton s
  337.   global gResellerVersion
  338.   puppetSprite(20, 1)
  339.   if gResellerVersion = 1 then
  340.     set the castNum of sprite s to cast "green restart"
  341.   end if
  342.   set the locH of sprite 20 to -1000
  343.   updateStage()
  344. end
  345.  
  346. on setDefaultMenuButton sp
  347.   global gCurrDialogButton
  348.   if voidp(gCurrDialogButton) or (gCurrDialogButton = 0) then
  349.     set gCurrDialogButton to 9
  350.     set lastsprite to gCurrDialogButton
  351.     set gCurrDialogButton to sp
  352.     set c to the castNum of sprite lastsprite
  353.     set the castNum of sprite lastsprite to c - 1
  354.     set c to the castNum of sprite gCurrDialogButton
  355.     set the castNum of sprite gCurrDialogButton to c + 1
  356.   end if
  357. end
  358.  
  359. on showChecksMenu menuNUm
  360.   global gFinishedTopics, gCurrSection
  361.   if voidp(gFinishedTopics) then
  362.     set gFinishedTopics to EMPTY
  363.   end if
  364.   puppetSprite(41, 1)
  365.   puppetSprite(42, 1)
  366.   puppetSprite(43, 1)
  367.   puppetSprite(44, 1)
  368.   puppetSprite(45, 1)
  369.   puppetSprite(46, 1)
  370.   puppetSprite(47, 1)
  371.   if gFinishedTopics = EMPTY then
  372.   end if
  373.   if gCurrSection <> EMPTY then
  374.   end if
  375.   if menuNUm = 2 then
  376.     if gFinishedTopics contains field "getting" then
  377.       showc(41)
  378.     else
  379.       setDefaultMenuButton(9)
  380.     end if
  381.     if gFinishedTopics contains field "working" then
  382.       showc(42)
  383.     else
  384.       setDefaultMenuButton(10)
  385.     end if
  386.     if gFinishedTopics contains field "organizing" then
  387.       showc(43)
  388.     else
  389.       setDefaultMenuButton(11)
  390.     end if
  391.     if gFinishedTopics contains field "customizing" then
  392.       showc(44)
  393.     else
  394.       setDefaultMenuButton(12)
  395.     end if
  396.   else
  397.     if menuNUm = 3 then
  398.       if gFinishedTopics contains field "dial" then
  399.         showc(41)
  400.       else
  401.         setDefaultMenuButton(9)
  402.       end if
  403.       if gFinishedTopics contains field "exchange" then
  404.         showc(42)
  405.       else
  406.         setDefaultMenuButton(10)
  407.       end if
  408.       if gFinishedTopics contains field "MSN" then
  409.         showc(43)
  410.       else
  411.         setDefaultMenuButton(11)
  412.       end if
  413.       if gFinishedTopics contains field "plug" then
  414.         showc(44)
  415.       else
  416.         setDefaultMenuButton(12)
  417.       end if
  418.       if gFinishedTopics contains field "system" then
  419.         showc(45)
  420.       else
  421.         setDefaultMenuButton(13)
  422.       end if
  423.       if gFinishedTopics contains field "plus" then
  424.         showc(46)
  425.       else
  426.         setDefaultMenuButton(14)
  427.       end if
  428.       if gFinishedTopics contains field "office" then
  429.         showc(47)
  430.       else
  431.         setDefaultMenuButton(15)
  432.       end if
  433.     end if
  434.   end if
  435.   updateStage()
  436. end
  437.  
  438. on hideChecks
  439.   puppetSprite(41, 0)
  440.   puppetSprite(42, 0)
  441.   puppetSprite(43, 0)
  442.   puppetSprite(44, 0)
  443.   puppetSprite(45, 0)
  444.   puppetSprite(46, 0)
  445.   puppetSprite(47, 0)
  446.   updateStage()
  447. end
  448.  
  449. on gop2
  450.   clearMenuButtons()
  451.   go("p2")
  452. end
  453.  
  454. on goCloser
  455.   global gMainMovieName
  456.   dialogClose()
  457.   go("closer", gMainMovieName)
  458. end
  459.  
  460. on goScan
  461.   go("endSniff", field "scan movie name")
  462. end
  463.  
  464. on doEndCloser
  465.   global gAutoMode, gTeaserMode, gResellerVersion, gCDROMversion
  466.   if gResellerVersion = 1 then
  467.     set gAutoMode to 0
  468.     set gTeaserMode to 0
  469.     go("black")
  470.   else
  471.     if (gResellerVersion = 0) and (gCDROMversion = 0) then
  472.       deleteFilesDialog()
  473.     else
  474.       doQuit()
  475.     end if
  476.   end if
  477. end
  478.  
  479. on goRestart
  480.   global gMainMovieName
  481.   dialogClose()
  482.   puppetSprite(24, 0)
  483.   if the movie = gMainMovieName then
  484.     go("intro1")
  485.   else
  486.     go("intro1", gMainMovieName)
  487.   end if
  488. end
  489.  
  490. on doDeleteFiles
  491.   if the machineType = 256 then
  492.     doQuit()
  493.   else
  494.     alert("On Windows Machine, Delete Files Here")
  495.   end if
  496. end
  497.  
  498. on doQuit
  499.   global gMainMovieName
  500.   dialogClose()
  501.   quit()
  502. end
  503.  
  504. on skipIntro
  505.   set the mouseDownScript to EMPTY
  506.   if the key = "s" then
  507.     go("skip")
  508.   end if
  509. end
  510.  
  511. on blinkForwardArrow
  512.   global gLastForwardBlink, gCurrCPButton
  513.   if gCurrCPButton = 1 then
  514.     set default to ".dark"
  515.   else
  516.     set default to EMPTY
  517.   end if
  518.   if (the ticks - gLastForwardBlink) > 25 then
  519.     if the castNum of sprite 24 = the number of cast ("next normal" & default) then
  520.       set num to cast ("next blink" & default)
  521.     else
  522.       if the castNum of sprite 24 = the number of cast ("next blink" & default) then
  523.         set num to cast ("next normal" & default)
  524.       end if
  525.     end if
  526.     set the castNum of sprite 24 to num
  527.     updateStage()
  528.     set gLastForwardBlink to the ticks
  529.   end if
  530. end
  531.  
  532. on showNextBtn
  533.   global gLastForwardBlink, gCurrCPButton
  534.   if gCurrCPButton = 1 then
  535.     set default to ".dark"
  536.   else
  537.     set default to EMPTY
  538.   end if
  539.   if the castNum of sprite 24 <> the number of cast ("next normal" & default) then
  540.     set the castNum of sprite 24 to cast ("next normal" & default)
  541.     updateStage()
  542.   end if
  543. end
  544.  
  545. on show s
  546.   set x to the locH of sprite s
  547.   if x < 0 then
  548.     set the locH of sprite s to x + 1000
  549.   end if
  550. end
  551.  
  552. on hide s
  553.   set x to the locH of sprite s
  554.   if x > 0 then
  555.     set the locH of sprite s to x - 1000
  556.   end if
  557. end
  558.  
  559. on showc s
  560.   set x to the locH of sprite s
  561.   if x < 0 then
  562.     set the locH of sprite s to ((x + 1000) * -1) + 5
  563.   end if
  564. end
  565.  
  566. on hidec s
  567.   set w to the width of sprite s / 2
  568.   set x to the locH of sprite s
  569.   if x > 0 then
  570.     set the locH of sprite s to ((x + 1000) * -1) - w
  571.   end if
  572. end
  573.